New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absolute-url

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absolute-url

Attaches .absoluteUrl() function to req

  • 1.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
476
increased by76.3%
Maintainers
1
Weekly downloads
 
Created
Source

absolute-url

Attaches .absoluteUrl() function to req.

Usage

// load module
var absoluteUrl = require('absolute-url')

// add routing
app.use(absoluteUrl())

// use it in your middleware
app.use(function (req, res, next) {
  console.log(req.absoluteUrl())
})

Attaching

If you don't know if absolute-url is used as middleware, it's possible to attach it dynamically. That is usefull inside of a middleware where you want to use an application specific instance (with options) or the default one.

app.use(function (req, res, next) {
  absoluteUrl.attach(req)

  console.log(req.absoluteUrl())
})

Keywords

FAQs

Package last updated on 20 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc